package com.g2room.tools.mybatisTool.to;

import java.io.Serializable;
import java.util.List;

public class ClazzTo implements Comparable<ClazzTo>, Serializable {
	private static final long serialVersionUID = -2105185147301661373L;
	/*
	 * 基础包名，po包为：basePkg + model.po;<br>
	 * service包为：basePkg + service;<br>
	 * mapper包为：basePkg + mapper;<br>
	 */
	private String basePkg;
	// po包名
	private String poPkg;
	// service包名
	private String servicePkg;
	// mapper包名
	private String mapperPkg;
	// 表名
	private String tableName;
	// 表注释
	private String remark;
	// xml mapper配置文件名称
	private String xmlName;
	// java po类名称
	private String poName;
	// java service类名称
	private String serviceName;
	// java mapper类名称
	private String mapperName;
	
	// ID字段，这里写死为：${id}
	private String idField;
	// po类别名，PO类首字母小写
	private String alias;
	// ResultMap的名称：alias+Map
	private String mapName;
	// PO序列化数值
	private String poSerialVersionUID;
	
	private List<Field> fields;
	// 额外引入的jar包
	private List<String> importPkgs;
	
	public String getPoSerialVersionUID() {
		return poSerialVersionUID;
	}

	public void setPoSerialVersionUID(String poSerialVersionUID) {
		this.poSerialVersionUID = poSerialVersionUID;
	}

	public List<String> getImportPkgs() {
		return importPkgs;
	}

	public void setImportPkgs(List<String> importPkgs) {
		this.importPkgs = importPkgs;
	}

	public String getBasePkg() {
		return basePkg;
	}

	public void setBasePkg(String basePkg) {
		this.basePkg = basePkg;
		this.poPkg = basePkg + "model.po";
		this.servicePkg = basePkg + "service";
		this.mapperPkg = basePkg + "mapper";
	}

	public String getPoPkg() {
		return poPkg;
	}

	public String getServicePkg() {
		return servicePkg;
	}

	public String getMapperPkg() {
		return mapperPkg;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public String getXmlName() {
		return xmlName;
	}

	public void setXmlName(String xmlName) {
		this.xmlName = xmlName;
	}

	public String getPoName() {
		return poName;
	}

	public void setPoName(String poName) {
		this.poName = poName;
	}

	public String getServiceName() {
		return serviceName;
	}

	public void setServiceName(String serviceName) {
		this.serviceName = serviceName;
	}

	public String getMapperName() {
		return mapperName;
	}

	public void setMapperName(String mapperName) {
		this.mapperName = mapperName;
	}

	public String getIdField() {
		return idField;
	}

	public void setIdField(String idField) {
		this.idField = idField;
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public String getMapName() {
		return mapName;
	}

	public void setMapName(String mapName) {
		this.mapName = mapName;
	}

	public List<Field> getFields() {
		return fields;
	}

	public void setFields(List<Field> fields) {
		this.fields = fields;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public int compareTo(ClazzTo other) {
		if (other == null) return 1;
		return this.getPoName().compareTo(other.getPoName());
	}
}
